import ServerFunction

def main():
    while True:
        menu()
        choice = int(input('请选择'))
        if choice in [0,1,2,3,4,5]:
            if choice == 0:
                answer = input('您确定要退出吗？y/n')
                if answer == 'y' or answer == 'Y':
                    print("感谢您的使用！")
                    break
                else:
                    continue
            if choice == 1:
                ServerFunction.insert()
            elif choice == 2:
                ServerFunction.search()
            elif choice == 3:
                ServerFunction.delete()
            elif choice == 4:
                ServerFunction.show()

def menu():
    print("====================主板信息管理系统====================")
    print("+-----------------------功能菜单----------------------+")
    print('|\t\t\t\t\t1.录入主板信息\t\t\t\t\t|')
    print('|\t\t\t\t\t2.查找主板信息\t\t\t\t\t|')
    print('|\t\t\t\t\t3.删除主板信息\t\t\t\t\t|')
    print('|\t\t\t\t\t4.所有主板信息\t\t\t\t\t|')
    print('|\t\t\t\t\t0.退出\t\t\t\t\t\t\t|')
    print("+-----------------------功能菜单----------------------+")

if __name__ == '__main__':
    main()


